#include <stdio.h>

void move (char* s , int k)
{

    char tmp [8] ;

    int num = 0 ;

    for (int i = 0 ; i < 8 - k ; i++)
    {

        tmp [i] = s [i + k] ;

        num++ ;
        
    }

    for (int i = 0 ; i < k ; i++)
    {

        tmp [num + i] = s [i] ;

    }

    for (int i = 0 ; i < 8 ; i++)
    {

        s [i] = tmp [i] ;

    }

}

int main ()
{

    char s [8] = { 'A' , 'B' , 'C' , 'D' , 'E' , 'F' , 'G' , 'H' } ;

    int k = 0 ;

    scanf ("%d" , &k) ;

    move (s , k % 8) ;

    for (int i = 0 ; i < 8 ; i++)
    {

        printf ("%c " , s [i]) ;

    }

    return 0 ;

}